package org.convallaria.infrastruct.ce.config;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Import;

/**
 * 企业级缓存自动配置类
 * 当存在Redis相关类且启用缓存时自动配置
 * 
 * @author gjh
 * @since 2024-09-24
 */
@AutoConfiguration
@ConditionalOnClass(name = "org.springframework.data.redis.core.RedisTemplate")
@ConditionalOnProperty(prefix = "convallaria.cache", name = "enabled", havingValue = "true", matchIfMissing = true)
@Import({
    RedisConfig.class, 
    SimpleCacheConfig.class,
    EnterpriseCacheConfig.class,
    CacheAopConfig.class,
    org.convallaria.infrastruct.ce.aspect.CacheAspect.class,
    org.convallaria.infrastruct.ce.util.CacheUtils.class,
    org.convallaria.infrastruct.ce.util.CacheKeyGenerator.class,
    org.convallaria.infrastruct.ce.util.RedisCacheUtils.class
})
public class SimpleRedisAutoConfiguration {
    // 自动配置类，通过@Import引入其他配置
}
